﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RayDen.RayEngine.Core.Interface;
using RayDen.RayEngine.Samplers;

namespace RayDen.RayEngine
{
    public class FilmFactory
    {
        private static ImageFilmBase film;

        public static IImageFilm CreateFilm(int width, int height, bool adaptive= false)
        {
            var imageFilm = adaptive ? (IImageFilm) new AdaptiveImageFilm(width, height) : new DefaultImageFilm(width, height);
            SamplerFactory.Instance.SetFilm(imageFilm);
            if (film == null)
            {
                film = (ImageFilmBase) imageFilm;
            }

            return imageFilm;
        }

        public static IImageFilm Cache
        {
            get { return film; }
        }
    }
}
